package spoon.dao;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import spoon.core.domain.Game;

@Repository
public class MarathonDaoImpl extends SqlSessionDaoSupport implements MarathonDao {

	@Autowired
	protected void init(SqlSessionFactory sqlSessionFactory) {
		setSqlSessionFactory(sqlSessionFactory);
	}

	@Override
	public void delete(Game league) {
		getSqlSession().delete("marathon.delete", league);
	}

	@Override
	public int addBetting(Game league) {
		return getSqlSession().insert("marathon.add", league);
	}
	
}
